package com.ruoyi.workYear.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.workYear.mapper.IfmWorkYearMapper;
import com.ruoyi.workYear.domain.IfmWorkYear;
import com.ruoyi.workYear.service.IIfmWorkYearService;

/**
 * 工作年限Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class IfmWorkYearServiceImpl implements IIfmWorkYearService 
{
    @Autowired
    private IfmWorkYearMapper ifmWorkYearMapper;

    /**
     * 查询工作年限
     * 
     * @param workId 工作年限主键
     * @return 工作年限
     */
    @Override
    public IfmWorkYear selectIfmWorkYearByWorkId(Long workId)
    {
        return ifmWorkYearMapper.selectIfmWorkYearByWorkId(workId);
    }

    /**
     * 查询工作年限列表
     * 
     * @param ifmWorkYear 工作年限
     * @return 工作年限
     */
    @Override
    public List<IfmWorkYear> selectIfmWorkYearList(IfmWorkYear ifmWorkYear)
    {
        return ifmWorkYearMapper.selectIfmWorkYearList(ifmWorkYear);
    }

    /**
     * 新增工作年限
     * 
     * @param ifmWorkYear 工作年限
     * @return 结果
     */
    @Override
    public int insertIfmWorkYear(IfmWorkYear ifmWorkYear)
    {
        ifmWorkYear.setCreateTime(DateUtils.getNowDate());
        return ifmWorkYearMapper.insertIfmWorkYear(ifmWorkYear);
    }

    /**
     * 修改工作年限
     * 
     * @param ifmWorkYear 工作年限
     * @return 结果
     */
    @Override
    public int updateIfmWorkYear(IfmWorkYear ifmWorkYear)
    {
        ifmWorkYear.setUpdateTime(DateUtils.getNowDate());
        return ifmWorkYearMapper.updateIfmWorkYear(ifmWorkYear);
    }

    /**
     * 批量删除工作年限
     * 
     * @param workIds 需要删除的工作年限主键
     * @return 结果
     */
    @Override
    public int deleteIfmWorkYearByWorkIds(Long[] workIds)
    {
        return ifmWorkYearMapper.deleteIfmWorkYearByWorkIds(workIds);
    }

    /**
     * 删除工作年限信息
     * 
     * @param workId 工作年限主键
     * @return 结果
     */
    @Override
    public int deleteIfmWorkYearByWorkId(Long workId)
    {
        return ifmWorkYearMapper.deleteIfmWorkYearByWorkId(workId);
    }
}
